package com.ukao.cashregister.widget;

import android.content.Context;
import android.util.AttributeSet;

import com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout;
import com.lcodecore.tkrefreshlayout.footer.LoadingView;
import com.lcodecore.tkrefreshlayout.header.SinaRefreshView;
import com.ukao.cashregister.R;

/**
 * Created by ukaodev on 2017/6/17.
 */

public class TwinklingLayout   extends TwinklingRefreshLayout {
    public TwinklingLayout(Context context) {
        this(context, null, 0);
        init(context);
    }

    public TwinklingLayout(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
        init(context);
    }

    public TwinklingLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }



    private void init(Context context) {
        SinaRefreshView headerView = new SinaRefreshView(context);
        headerView.setArrowResource(R.drawable.arrow);
        headerView.setTextColor(0xff745D5C);
        setHeaderView(headerView);
        LoadingView loadingView = new LoadingView(context);
        setBottomView(loadingView);

    }
}
